import router from "./router";
import Validator from "@/utils/Validator";
import tool from "./tool";
import emiiter from "./mitt";
import { Message, Modal, Notification  } from "@arco-design/web-vue";
export default function installPlugins(app) {
  // 事件总线
  app.config.globalProperties.emitter = emiiter;
  app.config.globalProperties.emit = emiiter.emit;
  app.config.globalProperties.on = emiiter.on;

  // 路由
  app.config.globalProperties.navigateTo = router.navigateTo;
  app.config.globalProperties.navigateBack = router.navigateBack;
  app.config.globalProperties.redirectTo = router.redirectTo;

  // 工具类
  app.config.globalProperties.isEmpty = Validator.isEmpty;
  app.config.globalProperties.isNotEmpty = Validator.isNotEmpty;
  app.config.globalProperties.replaceObj = tool.replaceObj;
  app.config.globalProperties.freeStore = tool.freeStore;
  app.config.globalProperties.groupBy = tool.groupBy;
  app.config.globalProperties.groupByToArray = tool.groupByToArray;
  app.config.globalProperties.fastId = tool.generate;

  // 消息提示
  app.config.globalProperties.modal = Modal;
  app.config.globalProperties.message = Message;
  app.config.globalProperties.notify = Notification;
  
}
